package com.atguigu.gmall.all.controller;

import com.atguigu.gmall.item.client.ItemFeignClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.annotation.Resource;
import java.util.Map;

@Controller
public class ItemController {

    @Resource
    private ItemFeignClient itemFeignClient;

    @GetMapping("/{skuId}.html")
    public String getItem(@PathVariable Long skuId, Map map){
        Map<String, Object> item = itemFeignClient.getItem(skuId);
        map.putAll(item);
        return "item/index";
    }
}